<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      layout:decorate="~{admin/layout}">
<body>

<div  class="content-wrap" layout:fragment="content">
    <main id="content" class="content" role="main">
        <ol class="breadcrumb">
            <li>财务管理</li>
            <li class="active">批次管理</li>
        </ol>
        <div class="row mb-lg">
            <div class="clearfix">
                <ul class="nav nav-tabs pull-xs-left" id="myTab" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link active" id="home-tab" data-toggle="tab" href="#basic" role="tab" aria-controls="basic" aria-expanded="true">现有批次</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="profile-tab" data-toggle="tab" href="#assumtion" role="tab" aria-controls="assumtion" aria-expanded="false">已消批次</a>
                    </li>
                </ul>
            </div>
            <div class="tab-content mb-lg" id="myTabContent">
                <div role="tabpanel" class="tab-pane active in clearfix" id="basic" aria-labelledby="basic-tab" aria-expanded="true">
                    <div class="widget-body">
                        <div class="mt">
                            <table class="table table-striped table-hover">
                                <thead>
                                <tr>
                                    <th>地块</th>
                                    <th>采购地</th>
                                    <th>树种</th>
                                    <th>胸径</th>
                                    <th>高度</th>
                                    <th>冠幅</th>
                                    <th>是否丛生</th>
                                    <th>枝条数</th>
                                    <th>数量</th>
                                    <th>信息更新</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="batch:${batchlist1}">
                                    <td th:text="${batch.landmass}"></td>
                                    <td th:text="${batch.location}"></td>
                                    <td th:text="${batch.standard}"></td>
                                    <td class="check" th:text="${batch.chestbreadth}"></td>
                                    <td class="check" th:text="${batch.height}"></td>
                                    <td class="check" th:text="${batch.crownwidth}"></td>
                                    <td th:switch="${batch.clump}">
                                        <span th:case="true">丛生</span>
                                        <span th:case="false">&nbsp;</span>
                                    </td>
                                    <td class="check" th:text="${batch.salenumber}"></td>
                                    <td th:text="${batch.number}"></td>
                                    <td>
                                        <i class="glyphicon glyphicon-pencil" id="bthd" style="color: #64bd63;"  data-toggle="modal" data-target="#myModal18"
                                           th:id="${batch.batch_id}" onclick="setid(this.id)">
                                        </i>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <script>
                                function setid(id) {
                                    $("#batch").val(id);
                                }
                                checknumber();
                            </script>
                        </div>
                    </div>
                </div>
                <div class="tab-pane" id="assumtion" role="tabpanel" aria-labelledby="assumtion-tab" aria-expanded="false">
                    <div class="widget-body">
                        <div class="mt">
                            <table class="table table-striped table-hover">
                                <thead>
                                <tr>
                                    <th>采购地</th>
                                    <th>树种</th>
                                    <th>胸径</th>
                                    <th>高度</th>
                                    <th>冠幅</th>
                                    <th>是否丛生</th>
                                    <th>枝条数</th>
                                    <th>采购数量</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="batch:${batchlist2}">
                                    <td th:text="${batch.location}"></td>
                                    <td th:text="${batch.standard}"></td>
                                    <td class="check" th:text="${batch.chestbreadth}"></td>
                                    <td class="check"  th:text="${batch.height}"></td>
                                    <td class="check" th:text="${batch.crownwidth}"></td>
                                    <td th:switch="${batch.clump}">
                                        <span th:case="true">丛生</span>
                                        <span th:case="false">&nbsp;</span>
                                    </td>
                                    <td class="check"  th:text="${batch.salenumber}"></td>
                                    <td th:text="${batch.number}"></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal fade" id="myModal18" tabindex="-1" role="dialog" aria-labelledby="myModalLabel18" aria-hidden="true" style="display: none;">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                            <h5 class="modal-title text-xl-center fw-bold mt" id="myModalLabel18">更新信息</h5>
                        </div>
                        <div class="modal-body bg-gray-lighter">
                            <form th:action="@{/admin/batch/update}" enctype="multipart/form-data" id="validation-form" class="form-horizontal form-label-left" method="post">
                                <input type="hidden" name="batch_id" id="batch" >
                                <span class="label label-warning  text-gray-dark mr-xs">更新</span>信息
                                <fieldset>
                                    <legend></legend>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" >
                                            胸径/地径
                                            <span class="help-block"></span>
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text" id="chestBreadth" name="chestBreadth" class="form-control" required="required">
                                            <input type="text"  name="chestBreadthmax" class="form-control" required="required">
                                        </div>
                                    </div>
                                </fieldset>
                                <fieldset>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3"  required="required">
                                            冠幅
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text"  name="crownWidth"  class="form-control">
                                            <input type="text"  name="crownWidthmax" class="form-control">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" >
                                            高度
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text"  name="height" class="form-control" required="required">
                                            <input type="text"  name="heightmax" class="form-control" required="required">
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3">
                                            枝条数量
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="text"   name="salenumber" class="form-control" >
                                            <input type="text"   name="salenumbermax" class="form-control" >
                                        </div>
                                    </div>
                                    <shiro:hasAnyRoles name="admin,finance">
                                        <div class="form-group row">
                                            <label class="control-label col-sm-3">
                                                价格
                                            </label>
                                            <div class="col-sm-9">
                                                <input type="text"   name="cost" class="form-control" >
                                            </div>
                                        </div>
                                    </shiro:hasAnyRoles>
                                    <div class="form-group row">
                                        <label class="control-label col-sm-3" >
                                            图片上传
                                        </label>
                                        <div class="col-sm-9">
                                            <input type="file" id="file" name="file" />
                                            <button type="submit" id="sub" class="btn btn-danger btn-rounded">提交</button>
                                        </div>
                                    </div>
                                </fieldset>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </main>

</div>

</body>
</html>